package com.qianying.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("sys_permission")
@Schema(description = "系统权限实体类，存储接口权限相关信息")
public class SysPermission {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    @Schema(description = "主键ID，自增", example = "1001", type = "integer", format = "int64")
    private Long id;

    /**
     * @Tag注解的name属性
     */
    @Schema(description = "控制器名称", example = "保险维护(保险类型管理)", maxLength = 255)
    private String name;

    /**
     * 控制器类全路径名
     */
    @TableField(value = "class_name")
    @Schema(description = "类名称", example = "com.qianying.controller.InsuranceTypeController", maxLength = 255)
    private String className;

    /**
     * 方法名
     */
    @TableField(value = "method_name")
    @Schema(description = "控制器中的方法名", example = "getAllInsuranceTypes", maxLength = 100)
    private String methodName;

    /**
     * 请求路径
     */
    @TableField(value = "request_mapping")
    @Schema(description = "接口的请求路径", example = "/admin/insuranceType", maxLength = 512)
    private String requestMapping;

    /**
     * 合并后的描述
     */
    @Schema(description = "接口描述", example = "保险类型信息的增删改查接口 - 查询所有保险类型列表")
    private String description;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @Schema(description = "记录创建时间", example = "2023-10-01T10:30:00", type = "string", format = "date-time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    @Schema(description = "记录最后更新时间", example = "2023-10-01T15:45:00", type = "string", format = "date-time")
    private LocalDateTime updateTime;

    /**
     * 父ID
     */
    @TableField(value = "parent_id")
    @Schema(description = "父权限ID，用于构建权限层级关系，顶级权限为0", example = "0", type = "integer", format = "int64")
    private Long parentId;

    @Schema(description = "输出给前端调用，true则选中", example = "false")
    @TableField(exist = false)
    private Boolean select = false;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


}
